/**
 * 
 */
package neptune.web.client.commands;

import neptune.web.client.view.ExperimentSummaryView;
import neptune.web.client.view.HistoryTokenUtils;
import neptune.web.client.view.OperativeView;
import neptune.web.client.view.SuperView;
import neptune.web.client.view.ViewManager;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.History;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 * 
 */
public class ExperimentSummaryCommand implements Command {

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.google.gwt.user.client.Command#execute()
	 */
	public void execute() {

		SuperView operative = (SuperView) ViewManager.getViewManager().getViewByName(
				OperativeView.DEFAULT_TOKEN);

		ExperimentSummaryView exps = (ExperimentSummaryView) operative
				.getViewByName(ExperimentSummaryView.DEFAULT_TOKEN);
		exps.reset();
		exps.update();

		History.newItem(HistoryTokenUtils.buildToken(
				OperativeView.DEFAULT_TOKEN,
				ExperimentSummaryView.DEFAULT_TOKEN));

	}

}
